package cn.com.pc.content.dto;

import cn.com.pc.content.domain.content.ContentType;
import cn.com.pc.content.domain.customizedContent.CustomizedContent;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.springframework.beans.BeanUtils;

/**
 * 自定义类型内容表单
 */
@EqualsAndHashCode(callSuper = true)
@Data
@ToString(callSuper = true)
public class CustomizedContentDTO extends ContentDTO {

    @JsonIgnore
    private ContentType contentType;

    public static CustomizedContentDTO from(CustomizedContent customizedContent) {
        CustomizedContentDTO CustomizedContentDTO = new CustomizedContentDTO();
        BeanUtils.copyProperties(customizedContent, CustomizedContentDTO);
        return CustomizedContentDTO;
    }
}
